#include "text_commands.h"
#include "core/value.h"
#include "core/inspector.h"
#include "media/itext.h"

using namespace Commands;
using namespace Commands::Core;

SetValue::SetValue()
: value(new Value())
{}
//-----------------------------------------------------------------------------
SetValue::SetValue(int value)
: value(new Value(value))
{}
//-----------------------------------------------------------------------------
SetValue::SetValue(const Value& value)
: value(value.Copy())
{}
//-----------------------------------------------------------------------------
SetValue::~SetValue()
{
    delete value;
}
//-----------------------------------------------------------------------------
void SetValue::Accept(Inspector& inspector)
{
    inspector.Inspect(*this);
}
//-----------------------------------------------------------------------------
SetValue* SetValue::Copy(void) const
{
    return new SetValue(*value);
}
//-----------------------------------------------------------------------------
float SetValue::Execute(const float seconds)
{
    float consumed_seconds = value->Execute(seconds);
    GetObject()->SetValue(value->GetValue());
	return 0.0f;
}
//-----------------------------------------------------------------------------
bool SetValue::IsFinished(void) const
{
    return value->IsFinished();
}
//-----------------------------------------------------------------------------
